const router = require('koa-router')() //导入 koa-router
const mysql = require("../../utils/db")  //导入 db.js
const { QUERY_SQL, ADD_SQL, EDIT_SQL, DELETE_SQL } = require("../../utils/dbSQL")

router.post('/loginSubmit', async (ctx, next) => {
    let checkData = ctx.request.body
    console.log(ADD_SQL);
    await mysql.query(ADD_SQL, checkData).then(async (res) => {
        ctx.body = {
            code: 200,
            message: "添加成功"
        }
    }).catch(e => {
        console.log("添加错误", e);
    })

})



module.exports = router

